$(function() {
	layui.use('code', function() {
		$('pre[data-src]').each(function() {
			var _this = this,
				src = this.getAttribute('data-src');
			$.get(src, function(res) {
				_this.innerHTML = res.slice(res.indexOf('<body>') - 1, res.lastIndexOf('</body>') + 7).replace(/\</g, "&lt;").replace(/\>/g, "&gt;");
				layui.code({
					elem: _this,
					title: src,
					encode: true,
					about: false
				});
			})
		});
	});
});